
import type { Directive, DirectiveBinding } from 'vue'
import { useMenuStore } from '../sotre/useMenuSotre';

export const permission: Directive = {
    mounted(el: HTMLElement, binding: DirectiveBinding<number>) {

      const menuStore=   useMenuStore();
        //用户按钮角色
        const roles=menuStore.roleButtonIds;
        const { value } = binding;
        if(!roles.includes(value)){
            
            el.parentNode && el.parentNode.removeChild(el);

           // el.style.display="none";
        }


       
        console.log(el);

        console.log("binding",binding);
        
        
         
    }
}